import type { VxeGridProps } from '#/adapter/vxe-table'
import { $t } from '@vben/locales'
// 列表表头
export const columns: VxeGridProps['columns'] = [
    {
        field: 'title',
        title: $t('page.system.children.menu.children.form.name'),
        treeNode: true,
        cellRender: { name: 'CopyText', props: { i18n: true } }
    },
    {
        field: 'path',
        title: $t('page.system.children.menu.children.form.path'),
        cellRender: { name: 'CopyText' }
    },
    {
        field: 'component',
        title: $t('page.system.children.menu.children.form.component'),
        cellRender: { name: 'CopyText' }
    },
    {
        field: 'permission',
        title: $t('page.system.children.menu.children.form.permission'),
        cellRender: { name: 'CopyText' }
    },
    { field: 'sort', title: $t('common.sort') },
    {
        field: 'status',
        title: $t('options.visible.title'),
        cellRender: {
            name: 'SwitchTag',
            props: {
                checkedChildren: $t('options.visible.children.visible'),
                uncheckedChildren: $t('options.visible.children.hidden')
            }
        }
    },
    {
        field: 'type',
        title: $t('page.system.children.menu.children.options.type.title'),
        cellRender: {
            name: 'SwitchTag',
            props: {
                checkedChildren: $t('page.system.children.menu.children.options.type.menu'),
                uncheckedChildren: $t('page.system.children.menu.children.options.type.button'),
                checkedValue: 0,
                checkedColor: 'blue',
                uncheckedColor: 'red'
            }
        }
    },
    { field: 'createTime', title: $t('common.createTime') },
    {
        field: 'action',
        fixed: 'right',
        slots: { default: 'action' },
        title: $t('common.action'),
        width: 120
    }
]

export const formSchema = [
    {
        component: 'Input',
        defaultValue: '',
        fieldName: 'title',
        label: $t('page.system.children.menu.children.form.name')
    }
]
